home *** CD-ROM | disk | FTP | other *** search
- #!/usr/bin/python
-
- import os
- import re
- import sys
-
-
- def main(args):
- devices = []
- command = "lspci"
- for line in os.popen(command).readlines():
- match = re.match("^.*(Network|Ethernet) controller: (.*)", line)
- if match:
- devices.append(match.group(2))
-
- if devices:
- print "\n".join(devices)
- else:
- print "Not found."
-
- return 0
-
-
- if __name__ == "__main__":
- sys.exit(main(sys.argv[1:]))
-